* BLS Consumer Price Index-All Urban Consumers (CU) 
* https://download.bls.gov/pub/time.series/cu

* Overview of BLS public database: https://download.bls.gov/pub/time.series/overview.txt

assert !missing("$SSDIMed")

* Source: https://download.bls.gov/pub/time.series/cu/cu.txt
* ==================================================================================
*  The following Consumer Price Index (All Urban Consumers) files are on the BLS 
*   internet in the sub-directory pub/time.series/cu:
* 
* 	cu.data.0.Current			                  -  All current year-to-date  
* 	cu.data.1.AllItems			                -  All items (item_code AA0, SA0)
* 	cu.data.2.Summaries			                -  Summaries (item_code SA0, SAF, SAH, SAA, SAT, SAM, SAR, SAE, SAG, SAS, SAC)
* 	cu.data.3.AsizeNorthEast		            -  A-Size areas in Northeast (area_code A1 ...)
* 	cu.data.4.AsizeNorthCentral		          -  A-size areas in North Central (area_code A2 ...)
* 	cu.data.5.AsizeSouth			              -  A-Size areas in South (area_code A3 ...)
* 	cu.data.6.AsizeWest			                -  A-Size areas in West (area_code A4 ...)
* 	cu.data.7.OtherNorthEast		            -  All other Northeast (area_code 01, X1, D1)
* 	cu.data.8.OtherNorthCentral		          -  All other North Central (area_code 02, X2, D2)
* 	cu.data.9.OtherSouth			              -  All other in South (area_code 03, X3, D3)
* 	cu.data.10.OtherWest			              -  All other in West (area_code 04, X4)  
* 	cu.data.11.USFoodBeverage		            -  All US Food and Beverage (area_code 0000, item_code SAF, SEF)
* 	cu.data.12.USHousing			              -  All US Housing (area_code 0000, item_code SAH, SEH)
* 	cu.data.13.USApparel			              -  All US Apparel (area_code 0000, item_code SAA, SEA)
* 	cu.data.14.USTransportation		          -  All US Transportation (area_code 0000, item_code SAT, SET)
* 	cu.data.15.USMedical			              -  All US Medical (area_code 0000, item_code SAM, SEM, SS57)
* 	cu.data.16.USRecreation			            - All US Recreation (area_code 0000, item_code SAR, SER, SS31, SS61, SS62)
* 	cu.data.17.USEducationAndCommunication	- All US Education and Communication (area_code 0000, item_code SAE, SEE, SS27)
* 	cu.data.18.USOtherGoodsAndServices	    - All US Other Goods and Services (area_code 0000, item_code SAG, SEG; SS33)
* 	cu.data.19.PopulationSize		            - All Population-size (area_code A000, X000, D000)
* 	cu.data.20.USCommoditiesServicesSpecial	- All US Commodity and Services and Special(area_code 0000, item_code SA0, SAC, SAN, SAS)
* 	cu.area					                        - Area codes mapping file
* 	cu.contacts				                      - Contacts for cu survey 
* 	cu.footnote				                      - Footnote codes mapping file
* 	cu.item					                        - Item codesmapping file
* 	cu.period				                        - Period codes mapping file
* 	cu.series				                        - All series and their beginning and end dates
* 	cu.txt					                        - General information
* ==================================================================================

if 0 {
  * downloaded 2020-07-23

  local frompath "https://download.bls.gov/pub/time.series/cu"
  local topath "$SSDIMed/data/raw/bls/cpi"
  cap mkdir "`topath'"
  
  * General information
  local file cu.txt
  copy "`frompath'/`file'" "`topath'/`file'"

  * All series and their beginning and end dates
  local file cu.series
  copy "`frompath'/`file'" "`topath'/`file'"

  * Period meanings
  local file cu.period
  copy "`frompath'/`file'" "`topath'/`file'"

  * Areas
  local file cu.area
  copy "`frompath'/`file'" "`topath'/`file'"

  * Summaries (item_code SA0, SAF, SAH, SAA, SAT, SAM, SAR, SAE, SAG, SAS, SAC)
  *
  * Example summary series we may care about:
  *   CUSR0000SA0 - All items in U.S. city average, all urban consumers, seasonally adjusted
  *   CUSR0000SAM - Medical care in U.S. city average, all urban consumers, seasonally adjusted
  *
  * File Structure and Format: The following represents the file format used to define each data file. 
  * 
  *   Field #/Data Element	Length		Value(Example)		
  *   -------------------------------------------------------
  *   1. series_id          17        CUUR0400AA0
  *   2. year                4        1966	
  *   3. period              3        M12		
  *   4. value              12        53.3	
  *   5. footnote_codes     10        It varies
  *   
  * The series_id (CUUR0400AA0) can be broken out into:
  *   survey abbreviation	  = CU    (Consumer Price Index)
  *   seasonal(code)		    = U     (S = Seasonally Adjusted, U = Unadjusted)
  *   periodicity_code	    = R     (R = Regular, S = Semi-Annual)
  *   area_code		          = 0400  (0000 = U.S. city average)
  *   item_code		          = AA0   (SA0 = All items, SAM = Medical care)
  local file cu.data.2.Summaries
  copy "`frompath'/`file'" "`topath'/`file'"

}


** EOF
